import request from '@/utils/request';

/**
 * 分页查询可租车辆
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function listVehicles(params) {
  return request({
    url: '/vehicle/list',
    method: 'get',
    params
  });
}

/**
 * 获取车辆详情
 * @param {number} id - 车辆ID
 * @returns {Promise}
 */
export function getVehicleDetail(id) {
  return request({
    url: `/vehicle/${id}`,
    method: 'get'
  });
}

/**
 * 添加车辆
 * @param {Object} data - 车辆信息
 * @returns {Promise}
 */
export function addVehicle(data) {
  return request({
    url: '/vehicle/add',
    method: 'post',
    data
  });
}

/**
 * 更新车辆状态
 * @param {number} id - 车辆ID
 * @param {number} status - 状态值
 * @returns {Promise}
 */
export function updateVehicleStatus(id, status) {
  return request({
    url: `/vehicle/status/${id}`,
    method: 'put',
    params: { status }
  });
}

/**
 * 获取车行的所有车辆
 * @param {number} shopId - 车行ID
 * @returns {Promise}
 */
export function getShopVehicles(shopId) {
  return request({
    url: `/vehicle/shop/${shopId}`,
    method: 'get'
  });
} 